object_name = IF ([condition]) THEN [expr_1] ELSE [expr_2];
Depending on the result of the condition, the object is set equal to the value of "expr_1" or "expr_2". The use of nested IF-THEN structures is allowed. In the condition statement the use of logic operators (e.g. the and-operator && or the or-operator ||) is allowed.
Example 1:
state.Var = IF (state.V < parameters.V_Max) && (parameters.Q_Pump > state.Q_In) THEN state.Q1 ELSE IF (state.Q_In < parameters.Q_Pump) THEN state.Q2 ELSE state.Q3;
Depending on the condition of the two IF statements the object "Var" is set equal to object "Q1", "Q2" or "Q3".
Example 2:
state.tp = IF (state.x > 10) THEN 5 ELSE 6;
If the variable "state.x" is greater than "10" the variable "state.tp" gets the value "5", else "state.tp" gets the value "6".